<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
	<div style="float: right;">
	<a href="javascript:void(0)" onclick="javascript:self.location='<%=g_basePath%>/storemgr/storeDetail.htm'"
		 class="btn btn-default" role="button">
		<spring:message	code="storeList.add" />
	</a>
	</div>

	<table class="table table-hover">
		<caption>
			<spring:message code="storeList" />
		</caption>
		<thead>
			<tr>
				<th>id</th>
				<th><spring:message code="storeList.code" /></th>
				<th><spring:message code="storeList.name" /></th>
				<th><spring:message code="storeList.addr" /></th>
				<th><spring:message code="storeList.tel" /></th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="store" items="${plInfo.dataList}" varStatus="status">
				<tr>
					<td>${store.id}</td>
					<td>${store.code}</td>
					<td>${store.name}</td>
					<td>${store.addr}</td>
					<td>${store.tel}</td>
					<td><a href="javascript:void(0)"
						onclick="javascript:self.location='<%=g_basePath%>/storemgr/get/${store.id}.htm'"><spring:message
								code="storeList.view" /></a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	
	
	
	<!--  -->
	<div>
		<ul class="pagination">
		
				<!-- 当前页是第一页，没有上一页，有下一页 -->
				<c:if test="${plInfo.currPageNum eq 1 }">
					<li class="disabled"><a>&laquo;</a></li>
					<c:forEach var="page" items="${plInfo.pageList}" varStatus="status">
						<c:choose>
							<c:when test="${page eq plInfo.currPageNum}">
								<li class="active"><a href="<%=g_basePath%>/storemgr/page/${page}.htm">${page}</a></li>
							</c:when>
							<c:otherwise>
								<li ><a href="<%=g_basePath%>/storemgr/page/${page}.htm">${page}</a></li>
							</c:otherwise>
						</c:choose>
						
					</c:forEach>
					<li ><a href="<%=g_basePath%>/storemgr/page/${plInfo.currPageNum+1}.htm">&raquo;</a></li>
				</c:if>
				
				<!-- 当前页不是第一页，也不是最后一页，有上一页和下一页-->
				<c:if test="${plInfo.currPageNum gt 1 && plInfo.currPageNum lt plInfo.totalPageNum}">
					<li><a href="<%=g_basePath%>/storemgr/page/${plInfo.currPageNum-1}.htm">&laquo;</a></li>
					<c:forEach var="page" items="${plInfo.pageList}" varStatus="status">
						<c:choose>
							<c:when test="${page eq plInfo.currPageNum}">
								<li class="active"><a href="<%=g_basePath%>/storemgr/page/${page}.htm">${page}</a></li>
							</c:when>
							<c:otherwise>
								<li ><a href="<%=g_basePath%>/storemgr/page/${page}.htm">${page}</a></li>
							</c:otherwise>
						</c:choose>
						
					</c:forEach>
					<li ><a href="<%=g_basePath%>/storemgr/page/${plInfo.currPageNum+1}.htm">&raquo;</a></li>
				</c:if>
				
				<!-- 当前是最后一页，有上一页，没有下一页-->
				<c:if test="${plInfo.currPageNum eq plInfo.totalPageNum}">
					<li><a href="<%=g_basePath%>/storemgr/page/${plInfo.currPageNum-1}.htm">&laquo;</a></li>
					<c:forEach var="page" items="${plInfo.pageList}" varStatus="status">
						<c:choose>
							<c:when test="${page eq plInfo.currPageNum}">
								<li class="active"><a href="<%=g_basePath%>/storemgr/page/${page}.htm">${page}</a></li>
							</c:when>
							<c:otherwise>
								<li ><a href="<%=g_basePath%>/storemgr/page/${page}.htm">${page}</a></li>
							</c:otherwise>
						</c:choose>
						
					</c:forEach>
					<li class="disabled"><a>&raquo;</a></li>
				</c:if>
				
			
		</ul>
	</div>
	

</body>
</html>
